Skip to content

Update util.py: Fix join_path function#119

Closed
neeraju wants to merge 1 commit into
gitpython-developers:0.3from
neeraju:patch-2
Closed

Update util.py: Fix join_path function#119
neeraju wants to merge 1 commit into
gitpython-developers:0.3from
neeraju:patch-2

Conversation

@neeraju

@neeraju neeraju commented Aug 19, 2013

Copy link
Copy Markdown

No description provided.

@jschlather

Copy link
Copy Markdown

Would it make more sense to just replace join_path with the standard library equivalent os.path.join?

Comment thread git/util.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters the meaning of this loop entirely, as any token (to be appended) which looks like an absolute path will completely replace the path concatenated so far.
The original intention of this function is to treat every path token (b) as relative path, which is what this portion tries to accomplish.
Unfortunately I don't know the reason for doing this, as nowadays I would prefer an assertion as all tokens should be relative.

@Byron

Byron commented Nov 19, 2014

Copy link
Copy Markdown
Member

os.path.join can't be used as it would insert backslashes on windows, which needs to be prevented in this case.
For now I will have to close this request, reason is given in the line comment.
Thanks for your understanding.

@Byron Byron closed this Nov 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants